<template>
    <div class="l-rblock l-form-viewer" style="padding:8px;">
        <l-code-mirror :readOnly="true" mode="application/json" :value="resData"   />
    </div>
</template>

<script>
const api = window.$api.apimanage.apimaintain

export default {
    props:{
        sendformEditRow:{
            f_Address:"",
            f_Code:""
        },
    },
    data(){
        return {
            activeName: 'tab0',
            formData: {
                responsestr:"", // 返回结果

            },
            rules: {
                
            },
            
        };
    },
    computed: {
        resData(){
            if(this.formData.responsestr){
                return JSON.stringify(JSON.parse(this.formData.responsestr), null, 2)
            }
            else{
                return ''
            }
        }
    },
    mounted() {
        this.init()
    },
    methods: {
        init() {
            
        },
        // Reset表单
        resetForm() {
            this.$refs.form.resetFields()
            this.activeName = 'tab0'
        },
        async loadFormData() {
            const postData={}
            postData.f_Address=this.sendformEditRow.f_Address.replace(/{learun_api}/g, this.apiUrl)
            postData.f_Code=this.sendformEditRow.f_Code
            const response = await this.$awaitWraper(api.callapi(this.sendformEditRow.f_Code,postData))
            this.formData.responsestr=response;
        },
    }
}
</script>